<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/base.css" />
<link rel="stylesheet" href="css/util.css" />
<link rel="stylesheet" href="css/collect.css" />
<title>医院列表</title>
</head>
<body>
<div class="content hos_list">
	<div class="navigate_head clearfix">
		<p class="navi_current" onclick="window.location.href='hos_list.html'">医院列表</p>
		<p class="" onclick="window.location.href='add_hos.html'">添加医院</p>
		<p class="navi_null"></p>
	</div>
	<!--<div class="hint">
		注：添加经纬度请至 http：//www.gpsspg.com/maps.htm 页面搜索该医院名称，并将结果提交
	</div>-->
	<!--头部功能-->
	<div class="head_area flex_vertical">
		<input type="text" class="search" placeholder="搜索医院" style="width: 280px;"/><button>搜索</button>
		<!--&nbsp;<button class="" style="position: absolute;right: 0;top: 0;">导出表格</button>-->
	</div>
	<table>
		<thead>
			<tr>
				<td>id</td>
				<td>用户名</td>
				<td>医院名称</td>
				<td>医院等级</td>
				<td>医院类型</td>
				<td>审核状态</td>
				<td>操作</td>
			</tr>
		</thead>
		<tbody class="tbody">
			<!--<tr>
				<td>1</td>
				<td>珍爱医疗门诊部(口腔科)</td>
				<td>专科</td>
				<td>省、市级</td>
				<td>待审核</td>
				<td>
					<button class="font_green">查看</button>&nbsp;&nbsp;<button class="font_green">删除</button>&nbsp;&nbsp;<button class="font_green">删除</button>
				</td>
			</tr>-->
		</tbody>
	</table>
	<!--分页-->
	<div class="page flex_vertical">
		<button class="" onclick="indexPage()">首页</button>&nbsp;
		<button class="" onclick="backPage()"><上一页</button>&nbsp;
		<!--页码-->
		<p class="page_num">
			<!--<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span>-->
		</p>....
		<button class="" onclick="nextPage()">下一页></button>&nbsp;
		<button class="" onclick="endPage()">末页</button>&nbsp;
		共<span class="all_recode">0 </span>记录&nbsp;|
		共<span class="all_page">0 </span>页&nbsp;
		到第<input class="select_page" />页&nbsp;
		<button class="confirm_page" onclick="skipPage()">确定</button>
	</div>
</div>
<!--遮罩层-->
<div class="shade none"></div>
<!--弹框-->
<div class="popup_box none">
	<p class="img_close clearfix">
		<img src="img/close.png" onclick="close_box()"/>
	</p>
	<div>
		<div class="public_input">
			<span style="width: 80px;">审核:</span>
			<input type="button" class="bg_green enabled" value="通过" data_val="true"/><input type="button" class="disable" value="不通过" data_val="false"/>
		</div>
		<div class="public_input clearfix cause_parent" style="display: none;">
			<span style="width: 80px;float: left;">原因:</span>
			<textarea class="cause" style="margin-left: 30px;width: 320px;float: left;min-height: 80px;"></textarea>
		</div>
	</div>
	<p class="confirm">确 定</p>
</div>

<script type="text/javascript" src="plug/jquery-1.11.3.js" ></script>
<script type="text/javascript" src="plug/template-web.js"></script>
<script type="text/javascript" src="js/toggle.js" ></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/method.js"></script>
<script type="text/javascript" src="js/page.js"></script>
<script type="text/javascript" src="js/detail/hos.js"></script>
<!--医院列表-->
<script id="test_hos_list" type="text/html">
	{{each data value}}
		<tr>
			<td width="40px">{{value.id}}</td>
			<td>{{value.username}}</td>
			<td>{{value.name}}</td>
			<td>{{value.hospitalLevel}}</td>
			<td>{{value.hospitalType}}</td>
			<td>{{if value.status=='unapplied'}}未申请认证{{else if value.status=='unchecked'}}未审核{{else if value.status=='pass'}}已审核通过{{else if value.status=='notpass'}}审核不通过{{/if}}</td>
			<td data_id="{{value.id}}">
				<button class="font_green" onclick="lookHos(this)">查看</button>&nbsp;&nbsp;<button class="font_green" onclick="editHos(this)">编辑</button><!--&nbsp;&nbsp;<button class="font_green" onclick="delHos(this)">删除</button>-->&nbsp;&nbsp;<button class="font_green" onclick="checkHos(this)">审核</button>
			</td>
		</tr>
	{{/each}}
</script>
<script>
//请求方法
function reqPage(data){
	console.log(data);
	control_page.init_page(data,function(data){
		//调用ajax
		$.get_ajax("/admin/hospital/getList.json",data,function(data){
			console.log(data);
			var html = template('test_hos_list',data);
			$(".tbody").html(html);
			//初始化分页
			control_page.currentPage(control_page.page_num,data.totalCount);
		});
	});
}
</script>
<script>
$(function(){
	reqPage(control_page.getData());
	
});
</script>
</body>
</html>
